package com.umakr.ax.core.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ~scl
 * @date 2017/5/4
 */

@PropertySource("classpath:config/props.properties")
@ConfigurationProperties("prop")
@Component
public class PropertiesModel {

    List<Integer> scoreType = new ArrayList<>();
    /**每天最多积分次数*/
    Integer maxScoreTimes ;

    public Integer[] getScoreTypeForIntegerList() {
        Integer[] values = new Integer[getScoreType().size()];
        for(int i = 0;i< scoreType.size();i++){
            values[i] =  scoreType.get(i);
        }
        return values;
    }

    public List<Integer> getScoreType() {
        return scoreType;
    }

    public void setScoreType(List<Integer> scoreType) {
        this.scoreType = scoreType;
    }

    public Integer getMaxScoreTimes() {
        return maxScoreTimes;
    }

    public void setMaxScoreTimes(Integer maxScoreTimes) {
        this.maxScoreTimes = maxScoreTimes;
    }
}

